// import Home from '@/pages/Home';
// import Login from '@/pages/Login';
// import Register from '@/pages/Register';
// import Search from '@/pages/Search';
// import Detail from '@/pages/Detail';
// import AddCartSuccess from '@/pages/AddCartSuccess';
// import ShopCart from '@/pages/ShopCart';
// import Trade from '@/pages/Trade';
// import Pay from '@/pages/Pay';
// import PaySuccess from '@/pages/PaySuccess';
// import Center from '@/pages/Center';
const routes = [
  {
    name: 'home',
    path: '/home',
    // component: () => import('@/pages/Home'),
    component: () => import('@/pages/Home'),
    meta: {
      isShowNav: true
    }
  },
  {
    name: 'login',
    path: '/login',
    // component: Login,
    component: () => import('@/pages/Login'),
    meta: {
      // 是否隐藏底部
      isHiddenFooter: true
    }
  },
  {
    name: 'register',
    path: '/register',
    // component: Register,
    component: () => import('@/pages/Register'),
    meta: {
      isHiddenFooter: true
    }
  },
  {
    name: 'search',
    // params参数需要添加一个占位
    // path: '/search',// 地址栏中只有query参数时的情况
    path: '/search/:keyword?', // 类似于正则中的? 表示0个或1个
    // component: Search
    component: () => import('@/pages/Search')
  },
  {
    name: 'detail',
    path: '/detail/:id',
    // component: Detail,
    component: () => import('@/pages/Detail'),
    props: true // 在组件内就可以使用props的方式来获取对应的params参数
  },
  {
    name: 'addCartSuccess',
    path: '/addCartSuccess',
    // component: AddCartSuccess
    component: () => import('@/pages/AddCartSuccess')
  },
  {
    name: 'shopCart',
    path: '/shopCart',
    // component: ShopCart
    component: () => import('@/pages/ShopCart')
  },
  {
    // 结算中心 在这个里面有收货的地址和购买的商品
    name: 'trade',
    path: '/trade',
    // component: Trade
    component: () => import('@/pages/Trade')
  },
  {
    // 付款界面 支付媒介
    name: 'pay',
    path: '/pay',
    // component: Pay
    component: () => import('@/pages/Pay')
  },
  {
    // 支持成功的界面
    name: 'paysuccess',
    path: '/paySuccess',
    // component: PaySuccess
    component: () => import('@/pages/PaySuccess')
  },
  {
    // 最后支付完成之后查看的之前的购物清单
    name: 'center',
    path: '/center',
    // component: Center
    component: () => import('@/pages/Center')
  },
  {
    path: '/',
    redirect: '/home'
  }
]

export default routes

// 13933336666
